package com.BraveY.Demo01;

import java.util.ArrayList;
import java.util.Scanner;

public class Demo02 {
    public static void main(String[] args) {
        Scanner S = new Scanner(System.in);
        ArrayList<Integer> List = new ArrayList<>();

        System.out.println("请输入您要排列元素的个数");
        int n = S.nextInt();

        for (int i = 0; i < n; i++) {
            System.out.println("请输入需要排列的数字");
            int num = S.nextInt();
            List.add(num);
        }
        // 输入的元素数组
        System.out.println(List);
        ArrayList<Integer> newList = new ArrayList<>();
        for (int i = List.size(); i >0 ; i--) {
            newList.add(List.get(i-1));
        }
        // 排序后的数组
        System.out.println(newList);



    }
}
